import request from '@/utils/request'
import { data } from 'jquery'

// 查询酒店列表
export function listHomestay (query) {
  return request({
    url: '/huacai/homestay/list',
    method: 'get',
    params: query
  })
}

// 查询酒店详细
export function getHomestay (homestayId) {
  return request({
    url: '/huacai/homestay/' + homestayId,
    method: 'get'
  })
}

// 新增酒店
export function addHomestay (data) {
  return request({
    url: '/huacai/homestay',
    method: 'post',
    data: data
  })
}

// 修改酒店
export function updateHomestay (data) {
  return request({
    url: '/huacai/homestay',
    method: 'put',
    data: data
  })
}

// 删除酒店
export function delHomestay (homestayId) {
  return request({
    url: '/huacai/homestay/' + homestayId,
    method: 'delete'
  })
}


// 通过景点ID查询附近酒店列表
export function selectHomestayBySpotsId (spotsId) {
  return request({
    url: '/huacai/homestay/selectHomestayBySpotsId/' + spotsId,
    method: 'get'
  })
}

// 通过餐厅ID查询附近酒店列表
export function selectHomestayByRestaurantId(restaurantId) {
  return request({
    url: `/huacai/homestay/selectHomestayByRestaurantId/${restaurantId}`,
    method: 'get'
  })
}

export function selectHomestayOrTagsList (data) {
  return request({
    url: '/huacai/homestay/selectHomestayOrTagsList',
    method: 'post',
    data
  })
}


/**
 * 账户充值
 */
export function updateUserAmount (amount) {
  return request({
    url: '/huacai/homestay/updateUserAmount/' + amount,
    method: 'put'
  })
}
